package core;

import gui.gui2d.highLevelPanels.ChatPanel;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Observable;

public class ChatActionListenerSend extends Observable implements MouseListener  {
	ChatPanel cp;
	public ChatActionListenerSend(ChatPanel cp) {
		this.cp=cp;
	}
	@Override
	public void mouseClicked(MouseEvent e) {
		if(!cp.getText().equals("Inserisci il testo qui:") && !cp.getText().isEmpty()){
			setChanged();
			notifyObservers(cp.getText());
			cp.clearMessage();
		}

	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
